package com.gmrz.webauthn.common;


import com.gmrz.webauthn.protocol.v1.processor.WebAuthnErrorCode;

public class WebAuthnRuntimeException
        extends RuntimeException {
    private static final long serialVersionUID = -3004699500111426273L;
    WebAuthnErrorCode ec;

    public WebAuthnRuntimeException() {
    }

    public WebAuthnRuntimeException(WebAuthnErrorCode ec, Throwable cause) {
        super(ec.toString());
        this.ec = ec;
    }

    public WebAuthnRuntimeException(WebAuthnErrorCode ec, String message) {
        super(message);
        this.ec = ec;
    }

    public WebAuthnRuntimeException(String message) {
        super(message);
    }

    public WebAuthnRuntimeException(Throwable cause) {
        super(cause);
    }

    public WebAuthnRuntimeException(String message, Throwable cause) {
        super(message, cause);
    }

    public WebAuthnErrorCode getErrorCode() {
        return this.ec;
    }
}
